package com.itheima.ArrayStudy;

public class ArrayDemo3 {
    public static void main(String[] args) {

        int[] scores = {90, 80, 70, 60, 100, 213, 50};
        test(scores);
    }

    public static void test(int[] arr) {
        int max = arr[0];
        int min = arr[0];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }else{
                sum += arr[i];
            }
            if (min > arr[i]) {
                min = arr[i];
            }
        }
        System.out.println("最大值是：" + max);
        System.out.println("最小值是：" + min);
    }
}
